<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<link rel='stylesheet' href='/static/plugins/luckysheet/plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='/static/plugins/luckysheet/plugins/plugins.css' />
<link rel='stylesheet' href='/static/plugins/luckysheet/css/luckysheet.css' />
<link rel='stylesheet' href='/static/plugins/luckysheet/assets/iconfont/iconfont.css' />
<script src="/static/plugins/luckysheet/plugins/js/plugin.js"></script>

<!-- rollup luckysheet.js -->
<script src="/static/plugins/luckysheet/luckysheet.umd.js"></script>
<script src="/static/plugins/luckysheet/luckyexcel.js"></script>
<style>

    html,
    body,
    .flex,
    article {
        height: 100%;
    }

    .flex article {
        display: flex;
        flex-direction: column;
    }

    .flex .top {

    }

    .flex .middle {
        flex: 1;
        height: 100%;
    }

    .flex .bottom {

    }
    .flex .middle {
        flex: 1;
        height: 100%;
    }
</style>
<section class="top-bottom flex">
    <article>
        <div class="top">
            <div>要填报的检测表</div>
            <div><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span></div>
        </div>
        <div class="middle" id="luckysheet"></div>
        <div class="bottom">
            <div id="prev">上一步</div>

            <a type="button" onclick="exportButton(this)">导出表格</a>
            <div id="save">保存</div>
            <div id="submit">保存并提交</div>
        </div>
    </article>
</section>


<script>
    var url=window.origin+"/static/fs/lsh创建的任务+20220813+报名数据详情.xlsx"






    LuckyExcel.transformExcelToLuckyByUrl(url, "lsh创建的任务+20220813+报名数据详情.xlsx", function (options){
        luckysheet.create({
            lang:"zh",
            showtoolbar:false,
            container: 'luckysheet', // luckysheet is the container id
            data:options.sheets,
            title:options.info.name,
            sheetFormulaBar:false,
            showinfobar:false,
            showsheetbar:true,
        });
    })




    $("#download").click(function (){
        LuckyExcel.transformLuckyToStream(luckysheet,function (blob){
            const downloadElement = document.createElement('a');
            let href = window.URL.createObjectURL(blob);
            downloadElement.href = href;
            downloadElement.download = "1.xlsx"
            document.body.appendChild(downloadElement);
            downloadElement.click();
            document.body.removeChild(downloadElement); // 下载完成移除元素
            window.URL.revokeObjectURL(href); // 释放掉blob对象

        });
    });

</script>
</body>
</html>
